import Vue from 'vue'
import Router from 'vue-router'

// 首页
import home from '../view/home.vue'

Vue.use(Router)

// 路由懒加载
// const home = () => import('../view/home.vue')
// 二级菜单子路由
// import upcoming from "../components/movie/upcome.vue"
// import sutra from '../components/movie/sutra.vue'
// import nowMain from "../components/movie/main.vue"
// 登陆注册二级菜单
// import login from '../components/loginRegister/login.vue'
// import register from '../components/loginRegister/register.vue'
// import find from '../components/loginRegister/find.vue'
// import music from '../components/boader/music.vue'
// import movie from '../components/boader/movie.vue'
// 预告片
// import videos from '../view/videos.vue'
// 音乐
// import musicdeltal from '../components/boader/musicDetal.vue'
// import { webpack } from 'webpack'
// 电影详情页
// import moviedetal from '../view/moviesDetail.vue'

export default new Router({
  mode: 'history',
  routes: [
    // 首页
    {
      path: '/',
      name: 'home',
      component: home,
      meta: {
        istrue: true
      }
    },
    // 电影
    {
      path: '/movie',
      name: 'movie',
      redirect: "/movie/now",
      component: () => import('../view/movie.vue'),
      children: [
        {
          path: '/movie/hot',
          component: () => import("../components/movie/upcome.vue"),
          meta: {
            istrue: true
          },
        },
        {
          path: '/movie/sut',
          component: () => import('../components/movie/sutra.vue'),
          meta: {
            istrue: true
          },
        },
        {
          path: '/movie/now',
          component: () => import("../components/movie/main.vue"),
          meta: {
            istrue: true
          },
        }
      ]
    },

    // 视频播放页面
    {
      path: '/videos',
      // name: videos,
      component: () => import('../view/videos.vue')
    },
    // 音乐播放页面
    {
      path: '/music/detal',
      // name: musicdeltal,
      component: () => import('../components/boader/musicDetal.vue')

    },
    // 电影详情页
    {
      path: '/movie/detail',
      // name:moviedetal,
      // component:moviedetal,
      component: () => import('../view/moviesDetail.vue'),
      meta: {
        istrue: true
      }
    },


    // 商品
    {
      path: "/shop",
      name: 'shop',
      component: () => import('../view/shopping.vue'),
      meta: {
        istrue: true
      }
    },
    // 商品详情
    {
      path: "/shopdetal",
      name: 'shopdetal',
      component: () => import('../view/shopDetal.vue'),
      meta: {
        istrue: true
      }
    },
    // 榜单 
    {
      path: '/listop',
      name: 'listop',
      component: () => import('../view/ListTop.vue'),
      redirect:'/listop/listTopOne',
      meta: {
        istrue: true
      },
      children: [
        // 榜单二级路由
        {
          path: '/listop/listTopOne',
          component: () => import('../components/listtop/listTopOne.vue'),
          meta: {
            istrue: true
          },
        },
        {
          path: '/listop/listTopTwo',
          component: () => import('../components/listtop/listTopTwo.vue'),
          meta: {
            istrue: true
          },
        }
      ]
    },
    // 登录注册
    {
      path: '/login',
      name: 'login',
      redirect: '/login/login',
      component: () => import('../view/loginRegis.vue'),
      children: [
        {
          path: '/login/login',
          name: 'login',
          component: () => import('../components/loginRegister/login.vue')
        },
        {
          path: '/login/register',
          name: 'register',
          component: () => import('../components/loginRegister/register.vue')
        },
        {
          path: '/login/find',
          name: 'find',
          component: () => import('../components/loginRegister/find.vue')
        }
      ]
    },
    // 热点
    {
      path: '/broad',
      name: 'broad',
      redirect: '/broad/movie',
      component: () => import('../view/border.vue'),
      children: [
        {
          path: '/broad/music',
          component: () => import('../components/boader/music.vue'),
          meta: {
            istrue: true
          }
        },
        {
          path: '/broad/movie',
          component: () => import('../components/boader/movie.vue'),
          meta: {
            istrue: true
          }
        }
      ],
      meta: {
        istrue: true
      }
    },
    // 影院
    {
      path: '/cinema',
      name: 'cinema',
      component: () => import('../view/cinema.vue'),
      meta: {
        istrue: true
      }
    },
    //演出 
    {
      path: '/show',
      name: 'show',
      redirect: '/show/recom',
      component: () => import('../view/Yshow.vue'),
      children: [
        {
          path: '/show/recom',
          component: () => import('../components/Yshow/showAll.vue')
        },
        {
          path: '/show/page/:index',
          component: () => import('../components/Yshow/showMx.vue')
        }
      ]
    },
    {
      path: '/Yshow/detail',
      name: 'showdetail',
      component: () => import('../components/Yshow/showMxDetail.vue')
    },
    // 首页搜索页面路由
    {
      path: '/search',
      component: () => import('../components/searchCinmen.vue')
    },
    //演出页搜索
    {
      path: '/ySearch',
      component: () => import('../components/Yshow/chilDetail/yanchuSearch.vue')
    },
    // 个人中心
    {
      path: '/Mycenter',
      component: () => import('../view/Mycenter.vue'),
      meta: {
        keepAlive: false,
        login: true,
        title: 'home'
      }

    },
  ]
})
